home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-01-23 | 1.1 KB | 61 lines |
- public class Room extends ThingHolder
- {
- // A Room is a ThingHolder (i.e. it can contain other Things)
- // which also has exits represented by integers indicating
- // the map index of the Room to which that exit leads
-
- private int n,s,w,e;
-
- Room( String aName,
- // constructor
- String aDescription,
- int an,
- int as,
- int aw,
- int ae
- )
- {
- super( aName, aDescription ); // init super class
- this.n = an;
- this.s = as;
- this.w = aw;
- this.e = ae;
- }
-
- // access methods
- // n
- int getn() {
- return n;
- }
-
- void setn(int an) {
- this.n = an;
- }
-
- // s
- int gets() {
- return s;
- }
-
- void sets(int as) {
- this.s = as;
- }
-
- // e
- int gete() {
- return e;
- }
-
- void sete(int ae) {
- this.e = ae;
- }
-
- // w
- int getw() {
- return w;
- }
-
- void setw(int aw) {
- this.w = aw;
- }
- }